package com.scheudler.demo.quartz.spring;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.quartz.SchedulerFactoryBean;

/**
 * @author dongqun
 * @version 1.0
 * @description spring环境中集成quartz
 * @date 2019/9/24 14:09
 */
@Configuration
@EnableScheduling
public class TaskConfigure {

    @Bean
    public SchedulerFactoryBean schedulerFactoryBean(){
        SchedulerFactoryBean schedulerFactoryBean =  new SchedulerFactoryBean();
        schedulerFactoryBean.setConfigLocation(new ClassPathResource("/quartz.properties"));
        return schedulerFactoryBean;
    }

}
